<?php

/**
 * League form.
 *
 * @package    vogue
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class LeagueForm extends BaseLeagueForm
{
  public function configure()
  {
  		//unset();
  		
			# WIDGETS
      $this->widgetSchema['name'] 	    = new sfWidgetFormInputText(array(), array());
      $this->widgetSchema['logo']    		= new sfWidgetFormInputFile(array(), array());
      $years = range(date('Y')-20, date('Y'));
      $this->widgetSchema['founded']    = new sfWidgetFormDate(array('format'=>'%year%', 'years'=>array_combine($years, $years)), array());
      $this->widgetSchema['owner']      = new sfWidgetFormInputText();
    	$this->widgetSchema['biography']  = new sfWidgetFormTextarea(array(), array());
    	  	
    	# VALIDATORS
    	$this->validatorSchema['name']   	 = new sfValidatorString();
    	$this->validatorSchema['founded']  = new sfValidatorPass();
    	$this->validatorSchema['owner']    = new sfValidatorPass();
    	$this->validatorSchema['biography']= new sfValidatorPass();
    	$this->validatorSchema['logo'] 		 = new sfValidatorFile($this->getFileAttrs('l'), $this->getFileOpts());
    	
    	# HELP
    	$this->widgetSchema->setHelp('logo', $this->getFileHelp());
  }

}
